<include file="public@header"/>
<style type="text/css">
    .pic-list li {
        margin-bottom: 5px;
    }
</style>
<script type="text/html" id="photos-item-tpl">
    <li id="saved-image{id}">
        <input id="photo-{id}" type="hidden" name="photo_urls[]" value="{filepath}">
        <input class="form-control" id="photo-{id}-name" type="text" name="photo_names[]" value="{name}"
               style="width: 200px;" title="图片名称">
        <img id="photo-{id}-preview" src="{url}" style="height:36px;width: 36px;"
             onclick="imagePreviewDialog(this.src);">
        <a href="javascript:uploadOneImage('图片上传','#photo-{id}');">替换</a>
        <a href="javascript:(function(){$('#saved-image{id}').remove();})();">移除</a>
    </li>
</script>
<script type="text/html" id="files-item-tpl">
    <li id="saved-file{id}">
        <input id="file-{id}" type="hidden" name="file_urls[]" value="{filepath}">
        <input class="form-control" id="file-{id}-name" type="text" name="file_names[]" value="{name}"
               style="width: 200px;" title="文件名称">
        <a id="file-{id}-preview" href="{preview_url}" target="_blank">下载</a>
        <a href="javascript:uploadOne('文件上传','#file-{id}','file');">替换</a>
        <a href="javascript:(function(){$('#saved-file{id}').remove();})();">移除</a>
    </li>
</script>

<script type="text/html" id="shopimages-item-tpl">
    <li id="saved-image{id}">
        <input id="shopimages-{id}" type="hidden" name="shopimages_urls[]" value="{filepath}">
        <input class="form-control" id="shopimages-{id}-name" type="text" name="shopimages_names[]" value="{name}"
               style="width: 200px;" title="图片名称">
        <img id="shopimages-{id}-preview" src="{url}" style="height:60px;width: 60px;"
             onclick="imagePreviewDialog(this.src);">
        <a href="javascript:uploadOneImage('图片上传','#shopimages-{id}');">替换</a>
        <a href="javascript:(function(){$('#saved-image{id}').remove();})();">移除</a>
    </li>

    
</script>
<script type="text/html" id="cert-item-tpl"> 
    <li id="saved-image{id}">
        <input id="cert-{id}" type="hidden" name="cert_urls[]" value="{filepath}">
        <input class="form-control" id="cert-{id}-name" type="text" name="cert_names[]" value="{name}"
            style="width: 200px;" title="图片名称">
        <img id="cert-{id}-preview" src="{url}" style="height:36px;width: 36px;"
            onclick="imagePreviewDialog(this.src);">
        <a href="javascript:uploadOneImage('图片上传','#cert-{id}');">替换</a>
        <a href="javascript:(function(){$('#saved-image{id}').remove();})();">移除</a>
    </li>
</script>
</head>
<body>
<div class="wrap js-check-wrap">
    <form action="{:url('AdminIndex/updateInfo')}" method="post" class="form-horizontal  margin-top-20 ">
        <div class="row">
            <div class="col-md-9">
                <table class="table table-bordered">
                    <tr>
                        <th>二维码</th>
                        <td>
                            <a href="{$shop.qrcode}" target="_blank"><img src="{$shop.qrcode}"/></a>
                        </td>
                    </tr>
                    <tr>
                        <th>店名<span class="form-required">*</span></th>
                        <td>
                            <input class="form-control" type="text" name="post[shop_name]"
                                   required value="{$shop.shop_name}" placeholder="" />
                        </td>
                    </tr>
                    <tr>
                        <th>统一信用码</th>
                        <td>
                            <input class="form-control" type="text" name="post[license_id]" id="license_id" value="{$shop.license_id}" placeholder="" disabled>
                        </td>
                    </tr>
                    <tr>
                        <th>营业执照</th>
                        <td>
                            <img src="{$shop.certificate}">
                        </td>
                    </tr>
                    <tr>
                        <th>其他证照</th>
                        <td>
                            <ul id="certs" class="pic-list list-unstyled form-inline"></ul>
                                <notempty name="$shop.other_certificate">
                                    <foreach name=":explode(',',$shop['other_certificate'])" item="vo" key="key">
                                        <php>$img_url=cmf_get_image_preview_url($vo);</php>
                                        <li id="saved-image{$key}">
                                            <input id="cert-{$key}" type="hidden" name="cert_urls[]"
                                                value="{$vo}">
                                            <input class="form-control"  style="width: 200px;float: left;" id="cert-{$key}-name" type="text" placeholder="可粘贴网络图片链接"
                                                name="cert_names[]"
                                                value="{$vo.name|default=''}" style="width: 200px;" title="图片名称">
                                            <img id="cert-{$key}-preview"
                                                src="{:cmf_get_image_preview_url($vo)}"
                                                style="height:36px;width: 36px;"
                                                onclick="parent.imagePreviewDialog(this.src);">
                                            <a href="javascript:uploadOneImage('图片上传','#cert-{$key}');">替换</a>
                                            <a href="javascript:(function(){$('#saved-image{$key}').remove();})();">移除</a>
                                        </li>
                                    </foreach>
                                </notempty>
                            </ul>
                            <a href="javascript:uploadMultiImage('图片上传','#certs','cert-item-tpl');"
                                        class="btn btn-primary ">选择图片</a>
                        </td>
                    </tr>
                    <tr>
                        <th>法人身份证号</th>
                        <td>
                            <input class="form-control" type="text" name="post[idcard]" id="idcard" value="{$shop.idcard}" placeholder="" disabled>
                        </td>
                    </tr>
                    <tr>
                        <th>身份证照片</th>
                        <td>
                            
                            <img src="{$shop.id_pic1}" style="width: 250px;height: 160px;"/>
                            <img src="{$shop.id_pic2}" style="width: 250px;height: 160px;"/>
                        </td>
                    </tr>
                    <tr>
                        <th>地址</th>
                        <td>
                            <input class="form-control" type="text" name="post[shop_address]" id="shop_address" value="{$shop.shop_address}" placeholder="" >
                        </td>
                    </tr>
                    <tr>
                        <th>坐标</th>
                        <td>
                            <input class="form-control" style="width: 400px;float: left;" type="text" name="post[location]" id="location" value="{$shop.location}" placeholder="" ><div id="allmap"><a class="btn  btn-primary" href="javascript:parent.openIframeLayer('https://lbs.amap.com/console/show/picker','获取坐标',{area: ['960px', '650px']});">获取坐标</a></div>
                        </td>
                    </tr>
                    <tr>
                        <th>店内服务</th>
                        <td>
                            <php>
                                foreach($service as $k =>$v){
                                    if(in_array($v['id'],$shop_service)){
                                        $s = '&nbsp;&nbsp;<input type="checkbox" name="service[]" value="'.$v['id'].'" checked> '.$v['name'];
                                    }else{
                                        $s = '&nbsp;&nbsp;<input type="checkbox" name="service[]" value="'.$v['id'].'">'.$v['name'];
                                    }
                                    
                                    echo $s;
                                }
                            </php>
                               
                        </td>
                    </tr>
                    <tr>
                        <th>主营业务</th>
                        <td>
                            <php>
                                foreach($business as $k =>$v){
                                    if(in_array($v['id'],$shop_business)){
                                        $s = '&nbsp;&nbsp;<input type="checkbox" name="business[]" value="'.$v['id'].'" checked> '.$v['name'];
                                    }else{
                                        $s = '&nbsp;&nbsp;<input type="checkbox" name="business[]" value="'.$v['id'].'">'.$v['name'];
                                    }
                                    
                                    echo $s;
                                }
                            </php>
                        </td>
                    </tr>
                    <tr>
                        <th>经营范围</th>
                        <td>
                            <textarea class="form-control" type="text" name="post[scope]" id="scope" placeholder="" >{$shop.scope}</textarea>
                        </td>
                    </tr>
                    <tr>
                        <th>电话</th>
                        <td>
                            <input class="form-control" type="text" name="post[tel]" id="tel" value="{$shop.tel}" placeholder="电话" >
                        </td>
                    </tr>
                    <tr>
                        <th>营业时间</th>
                        <td>
                            <input class="form-control" type="text" name="post[onsale_time]" id="onsale_time" value="{$shop.onsale_time}" placeholder="如：9:00-20:00" >
                        </td>
                    </tr>
                    <tr>
                        <th>店铺相册(第一张请传门店主图)</th>
                        <td>
                            <style type="text/css">
                                .imglist img{
                                    width:120px;
                                    height: 120px;
                                    float: left;
                                }
                                .imglist ul{
                                    max-width: 300px;
                                }
                                .imglist ul li{
                                    margin-right: 10px;
                                }
                            </style>
                            <ul id="shopimages" class="pic-list list-unstyled form-inline"></ul>
                                <notempty name="$shop.shop_images">
                                    <foreach name=":explode(',',$shop['shop_images'])" item="vo" key="key">
                                        <php>$img_url=cmf_get_image_preview_url($vo);</php>
                                        <li id="saved-image{$key}">
                                            <input id="shopimages-{$key}" type="hidden" name="shopimages_urls[]"
                                                value="{$vo}">
                                            <input class="form-control" style="width: 200px;float: left;" id="shopimages-{$key}-name" type="text" placeholder="可粘贴网络图片链接"
                                                name="shopimages_names[]"
                                                value="{$vo.name|default=''}" style="width: 200px;" title="图片名称">
                                            <img id="shopimages-{$key}-preview"
                                                src="{:cmf_get_image_preview_url($vo)}"
                                                style="height:60px;width: 60px;"
                                                onclick="parent.imagePreviewDialog(this.src);">
                                            <a href="javascript:uploadOneImage('图片上传','#shopimages-{$key}');">替换</a>
                                            <a href="javascript:(function(){$('#saved-image{$key}').remove();})();">移除</a>
                                        </li>
                                    </foreach>
                                </notempty>
                            </ul>
                            <a href="javascript:uploadMultiImage('图片上传','#shopimages','shopimages-item-tpl');"
                                        class="btn btn-primary ">选择图片</a>
                        </td>
                    </tr>
                    <tr>
                        <th>是否审核通过</th>
                        <td>
                            <if condition="$shop['checked'] eq 1">已审核通过

                                <else/>
                                未通过
                            </if>
                        </td>
                    </tr>
                    
                </table>
                <hook name="portal_admin_article_edit_view_main"/>
               
            </div>
            <div class="form-group">
				<div class="col-sm-offset-2 col-sm-10">
                    <input class="form-control" type="hidden" id="id" name="post[id]" value="{$shop.id}">
					<button type="submit" class="btn btn-primary js-ajax-submit">{:lang('SAVE')}</button>
				</div>
			</div>
        </div>
    </form>
</div>
<script type="text/javascript" src="__STATIC__/js/admin.js"></script>
<script type="text/javascript">
    //编辑器路径定义
    var editorURL = GV.WEB_ROOT;
</script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.all.min.js"></script>

<script type="text/javascript">
	
</script>

</body>
</html>
